<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>全局组件</title>
</head>
<body>
    <div id="app">
        <h4>第一次使用</h4>
        <my-component></my-component>
    </div>
    <div id="app1">
        <h4>第二次使用</h4>
        <my-component></my-component>
    </div>
    <script type="text/javaScript"  charset="UTF-8" src="/JS文件/vue.js"></script>
    <script>
        // 注册
        Vue.component('my-component',{
            template:'<div><h1>这里是组件的内容</h1><h2>这里是组件的内容</h2></div>'
        });
        var app = new Vue({
            el:'#app',
        });
        var app1 = new Vue({
            el:'#app1',
        });
    </script>
</body>
</html>